<template>
  <div class="head">
    <div class="left"></div>
    <h1>汇杰人才市场</h1>
    <div class="date">当前时间为: {{date}}</div>
  </div>
</template>

<script>

export default {
  name: 'HeadContext',
  data () {
    return {
      date: ''
    }
  },
  methods: {
    getDate () {
      this.date = setInterval(() => {
        const date = new Date()
        const time = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + '  ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
        this.date = time
        return time
      }, 1000)
    }
  },
  mounted () {
    this.getDate()
  }
}
</script>

<style lang="scss" scoped>
@import "src/assets/scss/var_";

.head {
  width: 100%;
  display: flex;
  justify-content: space-between;

  .left {
    flex: 1;
  }

  h1 {
    flex: 1;
    color: $primary_txtColor;
    text-align: center;
    font-size: 20px;
  }

  .date {
    flex: 1;
    height: 100%;
    color: #54cff9;
    text-align: right;
  }
}

</style>
